#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    int n;
    cin>>n;
    vector<int> v(n+1);
    for(int i=0;i<=n;i++){
        cin>>v[i];
    }
    bool f=0;
    for(int i=0;i<=n;i++){
        string num=to_string(abs(v[i]));
        if(v[i]>0){
            if(!f){
                cout<<(num=="1"?"":num);
                if(n-i==1)cout<<"x";
                else if(n-i)cout<<"x^"<<n-i;
                f=1;
            }
            else{
                if(i==n)cout<<"+"<<num;
                else{
                    cout<<"+"<<(num=="1"?"":num);
                    if(n-i==1)cout<<"x";
                    else cout<<"x^"<<n-i;
                }
            }
        }
        else if(v[i]<0){
            if(i==n)cout<<"-"<<num;
            else{
                cout<<"-"<<(num=="1"?"":num);
                f=1;
                if(n-i==1)cout<<"x";
                else cout<<"x^"<<n-i;
            }
        }
    }

    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    solve();

    return 0;
}